package com.zzyl.nursing.controller.menber;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 护理项目Controller
 *
 * @author ruoyi
 * @date 2024-09-30
 */
@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "家属查询护理项目接口")
public class MemberNursingProjectController extends BaseController
{
    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 查询护理项目列表
     */

    @GetMapping("/page")
    @ApiOperation(value = "获取护理项目列表")
    public TableDataInfo<List<NursingProject>> list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    @GetMapping("{id}")
    @ApiOperation(value = "获取护理项目详情")
    public AjaxResult get(@PathVariable Long id)
    {
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return success(nursingProject);
    }

}
